package com.sijiao.logapp.service.impl;

import com.sijiao.difflog.annotation.LogAop;
import com.sijiao.difflog.annotation.LogOriginalParam;
import com.sijiao.difflog.annotation.LogResultParam;
import com.sijiao.difflog.constants.SourceTypeEnum;
import com.sijiao.logapp.entity.Student;
import com.sijiao.logapp.service.IStudentService;
import org.springframework.stereotype.Service;

@Service
public class StudentServiceImpl implements IStudentService {

    @Override
    @LogAop(bizName = "student", resultType = SourceTypeEnum.param, originalType = SourceTypeEnum.none)
    public Student insert(@LogResultParam Student student) {
        System.out.println("insert student ...");
        return student;
    }

    @Override
    @LogAop(bizName = "student", resultType = SourceTypeEnum.none, originalType = SourceTypeEnum.returnValue)
    public Student delete(Student student) {
        System.out.println("delete student ...");
        return student;
    }

    @Override
    @LogAop(bizName = "student", resultType = SourceTypeEnum.param, originalType = SourceTypeEnum.api, beanType = LogStudentOriginalServiceImpl.class)
    public Student update(@LogOriginalParam @LogResultParam Student student) {
        System.out.println("update student ...");
        return student;
    }
}
